package com.fansl.allround.upms.api.feign;

import com.fansl.allround.common.core.constant.SecurityConstants;
import com.fansl.allround.common.core.constant.ServiceNameConstants;
import com.fansl.allround.upms.api.entity.SysRegion;
import com.fansl.allround.upms.api.feign.factory.RemoteRegionServiceFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

/**
 * @author fansl
 * @Description: region REMOTE
 * @date 2020/1/15 15:16
 */
@FeignClient(contextId = "remoteRegionService", value = ServiceNameConstants.UMPS_SERVICE, fallbackFactory = RemoteRegionServiceFallbackFactory.class)
public interface RemoteRegionService {
    /**
     * 批量新增
     * @param sysRegions
     * @return
     */
    @PostMapping("/inner/region/save")
    Boolean saveBatch(@RequestBody List<SysRegion> sysRegions, @RequestHeader(SecurityConstants.FROM) String from);
}
